﻿package org.electric.service;

import java.sql.SQLException;
import java.util.List;

import org.electric.bean.CompanyBean;
import org.electric.bean.industryBean;
import org.electric.bean.productBean;
import org.electric.dao.CompanyDao;

public class CompanyService {
	CompanyDao cd=new CompanyDao();
// public boolean addCompany(CompanyBean combean) throws SQLException{
//	 boolean falg=false;
//	 CompanyDao cd=new CompanyDao();
//	 if(cd.addCompanyBean(combean)!=0){
//		 falg=true;
//	 }
//	return falg;
// }
// public CompanyBean login(CompanyBean combean) throws Exception{
//	 CompanyDao cd=new CompanyDao();
//	 return cd.login(combean);
// }
// public List<productBean> selectproudct(String license) throws SQLException{
//	 CompanyDao cd=new CompanyDao();
//	return cd.selectproduct(license);
// }
	public List<productBean> productDisplay(int nub) throws SQLException{
		return cd.productDisplay(nub);
	}
	public int getproductcount() throws SQLException{
		return cd.getproductcount();
	}
	public CompanyBean selectCompany(CompanyBean company) throws SQLException{
		if(cd.selectCompanyExist(company)!=0){
			return cd.selectCompany(company);
		}else{
		return null;
		}
	}
	public List<CompanyBean> selecAllCompany() throws SQLException{
		if(cd.selectAllCompany()!=null){
			return cd.selectAllCompany();
		}
		return null;
	}
	//获取行业动态新闻 集合
			public List<industryBean> industryDisplay(int nub) throws SQLException{	
				return cd.industryDisplay(nub);
			}
			//获取总的新闻条数；
			public int getindustry() throws SQLException{
				return cd.getindustry();
			}
}
